using System.Collections;
using UnityEngine;
using UnityEngine.Android;
using UnityEngine.SceneManagement;

public class PermissionTool : MonoBehaviour
{
    IEnumerator Start()
    {
        Permission.RequestUserPermission(Permission.Camera);
        Permission.RequestUserPermission(Permission.Microphone);
        Permission.RequestUserPermission(Permission.FineLocation);
        Permission.RequestUserPermission(Permission.ExternalStorageRead);
        Permission.RequestUserPermission(Permission.ExternalStorageWrite);


        if (!Permission.HasUserAuthorizedPermission(Permission.Camera))
        {
            yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
        }

        if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
        {
            yield return Application.RequestUserAuthorization(UserAuthorization.Microphone);
        }

        SceneManager.LoadSceneAsync("Main");
    }
}
